package com.kun.lagou.user.starter.autoconfig;

import com.kun.lagou.user.starter.annotation.LoginUserIdResolver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**
 * @author Administrator
 */
@Configuration
@Component
public class UserAutoConfiguration implements WebMvcConfigurer {
    @Autowired
    private LoginUserIdResolver loginUserIdResolver;


    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
        resolvers.add(loginUserIdResolver);
    }
}
